package oracle.springbootxm.dao.userdao;

import oracle.springbootxm.pojo.UserInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserMapper {
    @Select("select * from t_user where username = #{username}")
    @Results({
            @Result(property = "userid", column = "userid"),
            @Result(property = "username", column = "username"),
            @Result(property = "password", column = "password"),
            @Result(property = "phonenumber", column = "phonenumber"),
            @Result(property = "userpower",column = "userpower")
    })
    UserInfo queryUserInfoByName(String username);


    @Insert("insert into t_user(username,password,phonenumber) values(#{username},#{password},#{phonenumber})")
    void addUserInfo(UserInfo userInfo);

    @Insert("insert into t_user(username,password,phonenumber,userpower) values(#{username},#{password},#{phonenumber},#{userpower})")
    void addSuperUserInfo(UserInfo userInfo);
}
